package Logic;

/**
 * Created by qq65827 on 2015/1/30.
 */

/**
 * 打印99乘法表
 * 思路 控制两次循环
 */
public class multi {

    public static void main(String[] args) {

        for (int i = 1; i <= 9; i++) {
            for (int j = 0; j < i; j++) {
                System.out.print(i + "*" + j + "=" + i * j);
                System.out.print("\t"); //水平制表符，注意方向是反斜杠
            }
            System.out.println();
        }

        System.out.println("-----------------------------------------------");

        //可以考虑用一个循环来做

        for (int i = 1, j = 1; i <= 9; i++) {
            System.out.print(i + "*" + j + "=" + i * j);
            System.out.print("\t");
            if (i == j) {
                i=0;
                j++;
                System.out.println();
            }
        }
    }
}
